home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / borland / tpwn31.zip / PASCAL.ZIP / OLE.PAS < prev    next >
Pascal/Delphi Source File  |  1992-04-06  |  29KB  |  631 lines

  1.  
  2. {*******************************************************}
  3. {                                                       }
  4. {       Turbo Pascal for Windows Run-time Library       }
  5. {       Windows 3.1 API Interface Unit                  }
  6. {                                                       }
  7. {       Copyright (c) 1991 Borland International        }
  8. {                                                       }
  9. {*******************************************************}
  10.  
  11. unit OLE;
  12.  
  13. interface
  14.  
  15. uses WinTypes;
  16.  
  17. { Object types }
  18.  
  19. const
  20.   ot_Link = 1;
  21.   ot_Embedded = 2;
  22.   ot_Static = 3;
  23.  
  24.  
  25. { activate verbs }
  26.  
  27.   oleverb_Primary = 0;
  28.  
  29. type
  30.   POleTargetDevice = ^TOleTargetDevice;
  31.   TOleTargetDevice = record
  32.     otdDeviceNameOffset: Word;
  33.     otdDriverNameOffset: Word;
  34.     otdPortNameOffset: Word;
  35.     otdExtDevmodeOffset: Word;
  36.     otdExtDevmodeSize: Word;
  37.     otdEnvironmentOffset: Word;
  38.     otdEnvironmentSize: Word;
  39.     otdData: array[0..0] of Byte;
  40.   end;
  41.  
  42. const
  43. { flags used in some methods }
  44.  
  45.   of_Set = $0001;
  46.   of_Get = $0002;
  47.   of_Handler = $0004;
  48.  
  49. { return codes for OLE functions }
  50.  
  51. type
  52.   TOleStatus = Word;
  53.  
  54. const
  55.   ole_OK = 0;                     {  0   Function operated correctly }
  56.  
  57.   ole_Wait_For_Release = 1;       {  1   Command has been initiated, client  }
  58.                                   {      must wait for release. keep dispatching }
  59.                                   {      messages till ole_RELESE in callback }
  60.  
  61.   ole_Busy = 2;                   {  2   Tried to execute a method while another }
  62.                                   {      method is in progress. }
  63.  
  64.   ole_Error_Protect_Only = 3;     {  3   Ole APIs are called in real mode  }
  65.   ole_Error_Memory = 4;           {  4   Could not alloc or lock memory }
  66.   ole_Error_Stream = 5;           {  5   (TOleStream) stream error }
  67.   ole_Error_Static = 6;           {  6   Non static object expected }
  68.   ole_Error_Blank = 7;            {  7   Critical data missing }
  69.   ole_Error_Draw = 8;             {  8   Error while drawing }
  70.   ole_Error_Metafile = 9;         {  9   Invalid metafile }
  71.   ole_Error_Abort = 10;           {  10  Client chose to abort metafile drawing }
  72.   ole_Error_Clipboard = 11;       {  11  Failed to get/set clipboard data }
  73.   ole_Error_Format = 12;          {  12  Requested format is not available }
  74.   ole_Error_Object = 13;          {  13  Not a valid object }
  75.   ole_Error_Option = 14;          {  14  Invalid option (link update / render) }
  76.   ole_Error_Protocol = 15;        {  15  Invalid protocol }
  77.   ole_Error_Address = 16;         {  16  One of the pointers is invalid }
  78.   ole_Error_Not_Equal = 17;       {  17  Objects are not equal }
  79.   ole_Error_Handle = 18;          {  18  Invalid handle encountered }
  80.   ole_Error_Generic = 19;         {  19  Some general error }
  81.   ole_Error_Class = 20;           {  20  Invalid class }
  82.   ole_Error_Syntax = 21;          {  21  Command syntax is invalid }
  83.   ole_Error_DataType = 22;        {  22  Data format is not supported }
  84.   ole_Error_Palette = 23;         {  23  Invalid color palette }
  85.   ole_Error_Not_Link = 24;        {  24  Not a linked object }
  86.   ole_Error_Not_Empty = 25;       {  25  Client doc contains objects. }
  87.   ole_Error_Size = 26;            {  26  Incorrect buffer size passed to the api }
  88.                                   {      that places some string in caller's }
  89.                                   {      buffer }
  90.   ole_Error_Drive = 27;           {  27  Drive letter in doc name is invalid }
  91.   ole_Error_Network = 28;         {  28  Failed to establish connection to a }
  92.                                   {      network share on which the document }
  93.                                   {      is located }
  94.   ole_Error_Name = 29;            {  29  Invalid name (doc name, object name), }
  95.                                   {      etc.. passed to the APIs }
  96.   ole_Error_Template = 30;        {  30  Server failed to load template }
  97.   ole_Error_New = 31;             {  31  Server failed to create new doc }
  98.   ole_Error_Edit = 32;            {  32  Server failed to create embedded }
  99.                                   {      instance }
  100.   ole_Error_Open = 33;            {  33  Server failed to open document,  }
  101.                                   {      possible invalid link }
  102.   ole_Error_Not_Open = 34;        {  34  Object is not open for editing }
  103.   ole_Error_Launch = 35;          {  35  Failed to launch server }
  104.   ole_Error_Comm = 36;            {  36  Failed to communicate with server }
  105.   ole_Error_Terminate = 37;       {  37  Error in termination }
  106.   ole_Error_Command = 38;         {  38  Error in execute }
  107.   ole_Error_Show = 39;            {  39  Error in show }
  108.   ole_Error_DoVerb = 40;          {  40  Error in sending do verb, or invalid }
  109.                                   {      verb }
  110.   ole_Error_Advise_Native = 41;   {  41  Item could be missing }
  111.   ole_Error_Advise_Pict = 42;     {  42  Item could be missing or server doesn't }
  112.                                   {      this format. }
  113.   ole_Error_Advise_Rename = 43;   {  43  Server doesn't support rename }
  114.   ole_Error_Poke_Native = 44;     {  44  Failure of poking native data to server }
  115.   ole_Error_Request_Native = 45;  {  45  Server failed to render native data }
  116.   ole_Error_Request_Pict = 46;    {  46  Server failed to render presentation }
  117.                                   {      data }
  118.   ole_Error_Server_Blocked = 47;  {  47  Trying to block a blocked server or }
  119.                                   {      trying to revoke a blocked server }
  120.                                   {      or document }
  121.   ole_Error_Registration = 48;    {  48  Server is not registered in regestation }
  122.                                   {      data base }
  123.   ole_Error_Already_Registered = 49;{ 49  Trying to register same doc multiple }
  124.                                   {     times }
  125.   ole_Error_Task = 50;            {  50  Server or client task is invalid }
  126.   ole_Error_OutOfDate = 51;       {  51  Object is out of date }
  127.   ole_Error_Cant_Update_Client = 52;{  52  embed doc's client doesn't accept  }
  128.                                   {      updates }
  129.   ole_Error_Update = 53;          {  53  erorr while trying to update  }
  130.  
  131.   ole_Error_Setdata_Format = 54;  { 54  Server app doesn't understand the       }
  132.                                   {     format given to its SetData method      }
  133.   ole_Error_Static_From_Other_OS = 55; { 55 trying to load a static object created }
  134.                                   {    on another Operating System           }
  135.   {  Following are warnings    }
  136.  
  137.   ole_Warn_Delete_Data = 1000;    {      Caller must delete the data when he is }
  138.                                   {      done with it. }
  139.  
  140. {  Codes for CallBack events }
  141. type
  142.   TOle_Notification = Word;
  143.  
  144. const
  145.   ole_Changed = 0;            {  0 }
  146.   ole_Saved = 1;              {  1 }
  147.   ole_Closed = 2;             {  2 }
  148.   ole_Renamed = 3;            {  3 }
  149.   ole_Query_Paint = 4;        {  4  Interruptible paint support }
  150.   ole_Release = 5;            {  5  Object is released (asynchronous operation }
  151.                               {     is completed) }
  152.   ole_Query_Retry = 6;        {  6  Query for retry when server sends busy ACK }
  153.  
  154.  
  155. type
  156.   TOle_Release_Method = Word;
  157.  
  158. const
  159.   ole_None = 0;                {  0  no method active }
  160.   ole_Delete = 1;              {  1  object delete }
  161.   ole_LnkPaste = 2;            {  2  PasteLink (auto reconnect) }
  162.   ole_EmbPaste = 3;            {  3  paste (and update)  }
  163.   ole_Show = 4;                {  4  Show }
  164.   ole_Run = 5;                 {  5  Run }
  165.   ole_Activate = 6;            {  6  Activate }
  166.   ole_Update = 7;              {  7  Update }
  167.   ole_Close = 8;               {  8  Close }
  168.   ole_Reconnect = 9;           {  9  Reconnect }
  169.   ole_SetUpdateOptions = 10;   {  10 setting update options }
  170.   ole_ServerUnlaunch = 11;     {  11 server is being unlaunched }
  171.   ole_LoadFromStream = 12;     {  12 LoadFromStream (auto reconnect) }
  172.   ole_SetData = 13;            {  13 OleSetData }
  173.   ole_RequestData = 14;        {  14 OleRequestData }
  174.   ole_O